package websocket

import (
	"gitee.com/thingple/saturn/cmd/dashboard/message"
	"gitee.com/thingple/saturn/internal/ws"
	"github.com/lishimeng/go-log"
)

func dataWs(data any, handler ws.TxHandler) {

	if data == nil {
		return
	}
	msg, ok := data.(message.BroadcastData)
	if !ok {
		log.Info("data wrong %v", data)
		return
	}
	handler(msg.Channel, "mq", msg.Data)
}
